import { createRouter, createWebHistory } from 'vue-router';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';

import orderRouter from './modules/order'
import userRouter from "@/router/modules/user.js";
import commentRouter from "@/router/modules/comment.js";
import flowRouter from "@/router/modules/flow.js";

NProgress.configure({ showSpinner: false });
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: 'login'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
      meta: {
        title: '登录'
      },
    },
    orderRouter,
    userRouter,
    commentRouter,
    flowRouter
  ],
  scrollBehavior() {
    return { top: 0 };
  },
});


export default router;
